"""
homework02 - 有一个放整数的列表，找出列表中出现次数最多的元素
Author: Administrator
Date: 2024/1/10
"""

nums = [10, 10, 1, 1, 10, 100, 100, 1, 10, 1]

items, max_counter = [nums[0]], nums.count(nums[0])
for num in nums[1:]:
    curr_counter = nums.count(num)
    if curr_counter > max_counter:
        items.clear()
        items.append(num)
        item, max_counter = num, curr_counter
    elif curr_counter == max_counter:
        if num not in items:
            items.append(num)
for item in items:
    print(item, max_counter)